#ifndef _CONTEXT_H_
#define _CONTEXT_H_

#include "../stdafx.h"
/*
#include "windows.h"
#include "gl/gl.h"
*/

// CContext stores the main device and render contexts
class CContext
{
private:
	HDC _hdc; // device context
	HGLRC _hglrc; // render context
//	CContext& operator = (const SContext& c);
public:
	CContext(CContext const& c){_hdc = c._hdc; _hglrc = c._hglrc;}
	CContext(){}
	CContext(HDC dc, HGLRC rc){set(dc, rc);}
	~CContext(){}
	void set(HDC dc, HGLRC rc);
	const HDC getDC(void) const {return _hdc;}
	const HGLRC getRC(void) const {return _hglrc;}
	BOOL makeCurrent(void) {return wglMakeCurrent(_hdc, _hglrc);}
	BOOL swapBuffers(void) {return SwapBuffers(_hdc);}
	void makeFromHWND(const HWND hwnd);
};


#endif //_CONTEXT_H_